home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-03-08 | 2.1 KB | 70 lines | [TEXT/ALFA] |
- # FILE: electricEnter.tcl
- #
- # LAST UPDATE: 01/06/93 6:52:23 AM
- #
- # This file contains the following TCL procedure(s):
- #
- # electricEnter -- similar to MPW ENTER key functionality
- #
- # This Alpha TCL proc (bound to Enter key) provides MPW like execution of
- # TCL commands.
- #
- # Results are inserted into the window just like MPW. Sort of like Shell
- # mode in a regular text window.
- #
- # To use, simply place this file in the a folder named $HOME:Tcl:Usercode:
- # add 'source $HOME:Tcl:Usercode:electricEnter.tcl' to AlphaBits.tcl.
-
- # COPYRIGHT:
- #
- # Copyright © 1992,1993 by David C. Black
- # All rights reserved.
- #
- # Redistribution and use in source and binary forms are permitted
- # provided that the above copyright notice and this paragraph are
- # duplicated in all such forms and that any documentation,
- # advertising materials, and other materials related to such
- # distribution and use acknowledge that the software was developed
- # by David C. Black.
- #
- # THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
- # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- #
- ################################################################################
-
- # AUTHOR
- #
- # David C. Black
- # Internet: black@mpd.tandem.com (preferred)
- # GEnie: D.C.Black
- # USnail: 6217 John Chisum Lane, Austin, TX 78749
- #
- ################################################################################
-
- # HISTORY
- #
- # modified who rev reason
- # -------- --- --- ------
- # 01/06/93 DCB 1.0 Original
-
- proc electricEnter {} {
- global _text
- global _returnText
- set window [lindex [winNames] 0]
- endOfLine
- set _text [getText [lineStart [getPos]] [getPos]]
- set errcode [uplevel #0 {catch $_text _returnText}]
- bringToFront $window
- if {$errcode != 0} {
- set _returnText "ERROR $errcode: $_returnText"
- }
- insertText -w $window "\r$_returnText"
- }
- #endproc electricEnter
- ################################################################################
-
- bind Enter electricEnter
- ################################################################################
-
-